<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>菜谱列表 - 智能菜谱推荐系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../../assets/css/common.css">
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
        <div class="container-fluid">
            <a class="navbar-brand" href="index.html">
                <i class="fas fa-utensils"></i>智能菜谱
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="index.html"><i class="fas fa-home"></i> 首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="recipes.html"><i class="fas fa-book"></i> 菜谱</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="recommend.html"><i class="fas fa-magic"></i> 推荐</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="ingredients.html"><i class="fas fa-carrot"></i> 我的食材</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="shopping.html"><i class="fas fa-shopping-cart"></i> 购物清单</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="cooking.html"><i class="fas fa-check-circle"></i> 我的打卡</a>
                    </li>
                </ul>
                <ul class="navbar-nav">
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="userDropdown" data-bs-toggle="dropdown">
                            <i class="fas fa-user-circle"></i> <span id="userName"></span>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="profile.html"><i class="fas fa-user"></i> 个人中心</a></li>
                            <li><a class="dropdown-item" href="collect.html"><i class="fas fa-heart"></i> 我的收藏</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="#" onclick="logout()"><i class="fas fa-sign-out-alt"></i> 退出登录</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container-fluid mt-4">
        <div class="filter-bar">
            <div class="row g-3 align-items-end">
                <div class="col-md-3">
                    <label class="form-label">菜谱名称</label>
                    <input type="text" class="form-control" id="searchName" placeholder="搜索菜谱">
                </div>
                <div class="col-md-2">
                    <label class="form-label">菜系</label>
                    <select class="form-select" id="cuisineType">
                        <option value="">全部</option>
                        <option value="川菜">川菜</option>
                        <option value="粤菜">粤菜</option>
                        <option value="家常菜">家常菜</option>
                        <option value="凉菜">凉菜</option>
                    </select>
                </div>
                <div class="col-md-2">
                    <label class="form-label">难度</label>
                    <select class="form-select" id="difficulty">
                        <option value="">全部</option>
                        <option value="1">简单</option>
                        <option value="2">中等</option>
                        <option value="3">困难</option>
                    </select>
                </div>
                <div class="col-md-2">
                    <label class="form-label">烹饪时间</label>
                    <select class="form-select" id="maxCookingTime">
                        <option value="">全部</option>
                        <option value="15">15分钟内</option>
                        <option value="30">30分钟内</option>
                        <option value="60">60分钟内</option>
                    </select>
                </div>
                <div class="col-md-3">
                    <button class="btn btn-primary" onclick="searchRecipes()">
                        <i class="fas fa-search"></i> 搜索
                    </button>
                    <button class="btn btn-secondary" onclick="resetSearch()">
                        <i class="fas fa-redo"></i> 重置
                    </button>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-body">
                <div id="recipeList" class="row">
                    <div class="loading">
                        <i class="fas fa-spinner fa-spin"></i> 加载中...
                    </div>
                </div>

                <nav id="pagination"></nav>
            </div>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/layer/3.5.1/layer.min.js"></script>
    <script src="../../assets/js/config.js"></script>
    <script src="../../assets/js/request.js"></script>
    <script src="../../assets/js/recipes.js"></script>
</body>
</html>

